package cn.com.zetatech.loader.util;

/**
 * @author jian.chen@zetatech.com.cn
 * @Description TODO
 * @Date 2024/8/26 20:06
 */
import java.util.List;

public class EnumFileParserClient {
    public static void main(String[] args) {
        String csvFilePath = "C:\\Users\\86130\\Downloads\\1723733999916.csv";
        String jsonFilePath = "C:\\Users\\86130\\Downloads\\data.json";

        // 解析CSV文件
        EnumFileParserType csvParser = EnumFileParserType.getParserByFileExtension("csv");
        List<?> csvPeople = csvParser.parse(csvFilePath);
        System.out.println("CSV File Parsed:");
        csvPeople.forEach(System.out::println);

        // 解析JSON文件
        EnumFileParserType jsonParser = EnumFileParserType.getParserByFileExtension("json");
        List<?> jsonPeople = jsonParser.parse(jsonFilePath);
        System.out.println("JSON File Parsed:");
        jsonPeople.forEach(System.out::println);
    }
}

